{yun:}include file="$wapstyle/member/cheader.htm"{/yun}
<link rel="stylesheet" href="{yun:}$wap_style{/yun}/js/mui/css/mui.picker.min.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<link rel="stylesheet" href="{yun:}$wap_style{/yun}/js/mui/css/mui.poppicker.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/style.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<link rel="stylesheet" href="{yun:}$wap_style{/yun}/js/umeditor/themes/default/css/umeditor.min.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<link rel="stylesheet" type="text/css" href="{yun:}$wap_style{/yun}/js/webapppic/cropper.css?v={yun:}$config.cachecode{/yun}" />
<script src="{yun:}$wap_style{/yun}/js/webapppic/cropper.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/compress.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>

<div id="app" class="mui-views">
    <div class="mui-view">
        <div class="mui-pages"></div>
    </div>
</div>


<div id="main" class="mui-page">
    
    <div class="mui-page-content">
        <div class="mui-scroll-wrapper">
            <div class="mui-scroll">
                <ul class="yunset_list mt15">
                    <li class="yunset_list_select"><span class="yunset_list_name">所在地</span><span class="yunset_list_commentary">
					<button id='cityPicker' class="mui-btn mui-btn-block" type='button' data-provinceid="{yun:}$row.provinceid{/yun}" data-cityid="{yun:}$row.cityid{/yun}" data-three_cityid="{yun:}$row.three_cityid{/yun}">{yun:}if $row.provinceid{/yun}{yun:}$city_name[$row.provinceid]{/yun} {yun:}$city_name[$row.cityid]{/yun} {yun:}$city_name[$row.three_cityid]{/yun}{yun:}else{/yun}请选择{yun:}/if{/yun}</button>
					<input type="hidden" id="provinceid" name="provinceid" value="{yun:}$row.provinceid{/yun}">
					<input type="hidden" id="cityid" name="cityid" value="{yun:}$row.cityid{/yun}">
					<input type="hidden" id="three_cityid" name="three_cityid" value="{yun:}$row.three_cityid{/yun}">
					</span></li>
                    <li class="yunset_list_text"><span class="yunset_list_name">公司地址</span><span class="yunset_list_commentary"> 
					<input type="text" name="address" id='address' value="{yun:}$row.address{/yun}" placeholder="请填写公司地址" >
					</span></li>
                </ul>
                 <input type="hidden" name="companyaddresid" value="{yun:}$row.id{/yun}" id='companyaddresid'>
                <input type="hidden" name="companyuid" value="{yun:}$companyuid{/yun}" id='companyuid'>
                <div class="yunset_bth_box"> <button id="infosubmit2" type="button" class="mui-btn mui-btn-block mui-btn-primary">保 存</button>
                </div>
			</div>
        </div>
    </div>
</div>


<script src="{yun:}$wap_style{/yun}/js/mui/mui.picker.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/mui/mui.poppicker.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$config.sy_weburl{/yun}/data/plus/city.cache.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/mui/mui.view.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/umeditor/umeditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$wap_style{/yun}/js/umeditor/umeditor.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$wap_style{/yun}/js/cominfo.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/category.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>

<script type="text/javascript">
    var formData = new FormData();

    var infosubmitBtn2 = document.getElementById('infosubmit2')
    if(infosubmitBtn2) {
        infosubmitBtn2.addEventListener('tap', checkinfo2, false)
    }


    function checkinfo2(){

        var provinceid = $.trim(document.getElementById('provinceid').value),
            cityid = $.trim(document.getElementById('cityid').value),
            three_cityid = $.trim(document.getElementById('three_cityid').value),
            address = $.trim(document.getElementById('address').value),
            companyuid = $.trim(document.getElementById('companyuid').value);
            companyaddresid = $.trim(document.getElementById('companyaddresid').value);

        if(cityid == ''){
            return mui.toast('请选择所在地！');
        }
        if(address == '') {
            return mui.toast('请填写公司地址！');
        }
       

        formData.append('provinceid', provinceid);
        formData.append('cityid', cityid);
        formData.append('three_cityid', three_cityid);
        formData.append('address', address);
        formData.append('companyuid', companyuid);
        formData.append('companyaddresid', companyaddresid);
        formData.append('submit', 'submit');

        $.ajax({
            url: "index.php?c=infoaddcompanyaddress",
            type: 'post',
            data: formData,
            contentType: false,
            processData: false,
            dataType: 'json',
            success: function(res) {
                var res = JSON.stringify(res);
                var data = JSON.parse(res);
                if(data.url) {
                    layermsg(data.msg, 2, function() {
                        location.href = data.url;
                    });
                } else {
                    layermsg(data.msg, 2);
                    return false;
                }
            }
        })
    }




</script>
{yun:}include file="$wapstyle/footer.htm"{/yun}